package Coding.IO;
/**
 * 序列化 反序列化 对象存储
 */

import java.io.FileInputStream;
import java.io.IOException;

/**
 *
 */
public class ObjectInputStream {


    public static void main(String[] args) throws IOException, ClassNotFoundException {

        FileInputStream fis = new FileInputStream("./demo.txt");

        java.io.ObjectInputStream ois = new java.io.ObjectInputStream(fis);

        Person p = (Person) ois.readObject();
        System.out.println(p);

        ois.close();


    }
}
